﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MvcApplication2.Views
{
    public static class ViewHelper
    {
        public static string GetPropValue(object src, string propName)
        {
            if (src == null) return string.Empty;

            var prop = src.GetType().GetProperty(propName);
            if (prop == null) return string.Empty;

            var value = prop.GetValue(src, null);

            if (value == null) return string.Empty;

            return value.ToString();
        }
    }
}